package com.handler

import com.Config
import com.amazonaws.auth.AWSStaticCredentialsProvider
import com.amazonaws.services.s3.AmazonS3
import com.amazonaws.services.s3.transfer.MyTransferManager
import com.entity.PackCmd

open class BaseHandler<T>(protected var transferManager: MyTransferManager?) {

    protected var s3Client: AmazonS3? = null
    protected val packCmd: PackCmd

    init {
        transferManager?.amazonS3Client?.let { s3Client = it }
        packCmd = Config.dataManage!!.packCmd
        this.execute()
    }

    /** 直接开始执行  */
    protected open fun execute() {}

    /** 直接开始执行  */
    open fun execute(value: T) {}

    companion object {
        private val awsStaticCredentialsProvider: AWSStaticCredentialsProvider? = null
    }
}
